﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GeneratorLib.DB;
using System.Collections.ObjectModel;
using Pasys.PresentationCore;
using UIShell.OSGi;

namespace DBExplorer
{
    class DBProviderManager : IDBProviderManager
    {

        private readonly List<IDBProvider> _providers;
        public DBProviderManager()
        {
            _providers = new List<IDBProvider>();
        }

        #region IDBProviderManager Members

        public void Clear()
        {
            _providers.Clear();
        }

        public ReadOnlyCollection<IDBProvider> DBProviders
        {
            get
            {
                var array = _providers.ToArray();
                return new ReadOnlyCollection<IDBProvider>(array);
            }
        }
        public void UnRegister(IDBProvider provider)
        {
            _providers.Remove(provider);

        }
        public void Register(IDBProvider provider)
        {
            _providers.Add(provider);
        }

        #endregion


    }
}
